package mkis.service.root.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import mkis.service.root.data.dao.BbsDAO;
import mkis.service.root.data.model.Bbs;
import mkis.service.root.service.BbsSevice;

@Service("bbsService")
public class BbsServiceImpl implements BbsSevice{
	
	@Resource(name="bbsDAO")
	private BbsDAO bbsDAO;
	
	@Override
	public Map<String,Object> getNoticeListAndCnt(Map<String, Object> param) throws Exception {
		Map<String,Object> map=new HashMap<String, Object>();
		
		int cnt=bbsDAO.getNoticeListCnt(param);
		List<Bbs> list=bbsDAO.getNoticeList(param);
		
		map.put("list", list);
		map.put("cnt", cnt);
		return map;
	}
	
	@Override
	public Bbs getNotice(String boardSeq) throws Exception {
		return bbsDAO.getNotice(boardSeq);
	}
	
	@Override
	public int deleteNotice(List<String> boardSeqList) throws Exception {
		return bbsDAO.deleteNotice(boardSeqList);
	}
	
	
	@Override
	public Object insertNotice(Bbs bbs) throws Exception {
		return bbsDAO.insertNotice(bbs);
	}
	
	@Override
	public int updateNotice(Bbs bbs) throws Exception {
		return bbsDAO.updateNotice(bbs);
	}
}
